<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-CPP: AWTK-CPP</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">AWTK-CPP
   </div>
   <div id="projectbrief">AWTK CPP API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="doc-content">
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div><div class="header">
  <div class="headertitle"><div class="title">AWTK-CPP </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="md__r_e_a_d_m_e"></a> <a href="https://github.com/zlgopen/awtk">AWTK</a> 全称 Toolkit AnyWhere，是 <a href="http://www.zlg.cn/">ZLG</a> 开发的开源 GUI 引擎，旨在为嵌入式系统、WEB、各种小程序、手机和 PC 打造的通用 GUI 引擎，为用户提供一个功能强大、高效可靠、简单易用、可轻松做出炫酷效果的 GUI 引擎。</p>
<blockquote class="doxtable">
<p>欢迎广大开发者一起参与开发：生态共建计划。 </p>
</blockquote>
<h4><a href="https://github.com/zlgopen/awtk">AWTK</a> 寓意有两个方面：</h4>
<ul>
<li>Toolkit AnyWhere。</li>
<li>ZLG 物联网操作系统 AWorks 内置 GUI。</li>
</ul>
<h2>CPP 示例代码</h2>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;awtk_cpp.hpp&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;application.hpp&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> ret_t OnClick(<span class="keywordtype">void</span>* ctx, event_t* e) {</div>
<div class="line">  log_debug(<span class="stringliteral">&quot;on_click\n&quot;</span>);</div>
<div class="line">  <span class="keywordflow">return</span> RET_OK;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">bool</span> Application::Init(<span class="keywordtype">void</span>) {</div>
<div class="line">  <a class="code hl_class" href="class_t_widget.html">TWidget</a> wm = TWindowManager::Instance();</div>
<div class="line">  <a class="code hl_class" href="class_t_widget.html">TWidget</a> win = <a class="code hl_function" href="class_t_window.html#ac4fc6b5d8fac2932134569302a8488f9">TWindow::Create</a>(wm, 0, 0, 0, 0); </div>
<div class="line">  <a class="code hl_class" href="class_t_widget.html">TWidget</a> ok = <a class="code hl_function" href="class_t_button.html#a93e7fe9e9006d7714322384a05971635">TButton::Create</a>(win, 0, 0, 0, 0); </div>
<div class="line"> </div>
<div class="line">  ok.<a class="code hl_function" href="class_t_widget.html#ae5c7a947eca388f24639bba5c2a5d234">SetText</a>(<span class="stringliteral">&quot;ok&quot;</span>);</div>
<div class="line">  ok.<a class="code hl_function" href="class_t_widget.html#ad013e72c8f4335c676c24510025fb3bd">SetSelfLayoutParams</a>(<span class="stringliteral">&quot;center&quot;</span>, <span class="stringliteral">&quot;middle&quot;</span>, <span class="stringliteral">&quot;50%&quot;</span>, <span class="stringliteral">&quot;30&quot;</span>);</div>
<div class="line">  ok.<a class="code hl_function" href="class_t_widget.html#ad892041ab622a3df3aa6709312264aa6">On</a>(EVT_CLICK, OnClick, NULL);</div>
<div class="line"> </div>
<div class="line">  win.<a class="code hl_function" href="class_t_widget.html#acdb9b81afd693ebeb249249edaf7a804">Layout</a>();</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">bool</span> Application::Exit(<span class="keywordtype">void</span>) {</div>
<div class="line">  log_debug(<span class="stringliteral">&quot;application_exit\n&quot;</span>);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
<div class="ttc" id="aclass_t_button_html_a93e7fe9e9006d7714322384a05971635"><div class="ttname"><a href="class_t_button.html#a93e7fe9e9006d7714322384a05971635">TButton::Create</a></div><div class="ttdeci">static TWidget Create(TWidget &amp;parent, xy_t x, xy_t y, wh_t w, wh_t h)</div><div class="ttdef"><b>定义</b> awtk_cpp.cpp:4358</div></div>
<div class="ttc" id="aclass_t_widget_html"><div class="ttname"><a href="class_t_widget.html">TWidget</a></div><div class="ttdef"><b>定义</b> awtk_cpp.hpp:3423</div></div>
<div class="ttc" id="aclass_t_widget_html_acdb9b81afd693ebeb249249edaf7a804"><div class="ttname"><a href="class_t_widget.html#acdb9b81afd693ebeb249249edaf7a804">TWidget::Layout</a></div><div class="ttdeci">ret_t Layout()</div><div class="ttdef"><b>定义</b> awtk_cpp.cpp:1686</div></div>
<div class="ttc" id="aclass_t_widget_html_ad013e72c8f4335c676c24510025fb3bd"><div class="ttname"><a href="class_t_widget.html#ad013e72c8f4335c676c24510025fb3bd">TWidget::SetSelfLayoutParams</a></div><div class="ttdeci">ret_t SetSelfLayoutParams(const char *x, const char *y, const char *w, const char *h)</div><div class="ttdef"><b>定义</b> awtk_cpp.cpp:1698</div></div>
<div class="ttc" id="aclass_t_widget_html_ad892041ab622a3df3aa6709312264aa6"><div class="ttname"><a href="class_t_widget.html#ad892041ab622a3df3aa6709312264aa6">TWidget::On</a></div><div class="ttdeci">uint32_t On(uint32_t type, event_func_t on_event, void *ctx)</div><div class="ttdef"><b>定义</b> awtk_cpp.cpp:1470</div></div>
<div class="ttc" id="aclass_t_widget_html_ae5c7a947eca388f24639bba5c2a5d234"><div class="ttname"><a href="class_t_widget.html#ae5c7a947eca388f24639bba5c2a5d234">TWidget::SetText</a></div><div class="ttdeci">ret_t SetText(const char *text)</div><div class="ttdef"><b>定义</b> awtk_cpp.cpp:1278</div></div>
<div class="ttc" id="aclass_t_window_html_ac4fc6b5d8fac2932134569302a8488f9"><div class="ttname"><a href="class_t_window.html#ac4fc6b5d8fac2932134569302a8488f9">TWindow::Create</a></div><div class="ttdeci">static TWidget Create(TWidget &amp;parent, xy_t x, xy_t y, wh_t w, wh_t h)</div><div class="ttdef"><b>定义</b> awtk_cpp.cpp:5162</div></div>
</div><!-- fragment --><p><a href="classes.html">类列表</a> </p>
</div></div><!-- PageDoc -->
<a href="doxygen_crawl.html"></a>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2
</small></address>
</div><!-- doc-content -->
</body>
</html>
